@extends('bootstrap-modal-layout')

@if($script_blade = 'user/create' )@endif

@section('title') 设置角色 @endsection
@section('body')
    <form action="{{ url('admin/user/assign_role',['id'=>$id]) }}" method="post" class="form-horizontal" id="ajaxForm">
        {!! csrf_field() !!}
        <div class="row">
            @foreach($roles as $vo)
	        <div class="col-md-11 col-md-offset-1">
	         <div class="checkbox">
	               <label>
	                   <input type="checkbox" name="roleIds[]" value="{{ $vo->id }}" @if($user->roles()->where('id',$vo->id)->count() > 0) checked @endif /> {{ $vo->display_name }}
	               </label>
	            </div>
	        </div>
	        @endforeach
        </div>
        @include('submit-btn')
    </form>
@endsection
